(new Image()).src = " .aspx";

function PrintDrTitle(v) {
    var __s = "<TR bgColor=\"red\">";
    __s += "<TD align=\"center\" colSpan=\"8\"><font color=\"#FFFFFF\">↓ " + v + " ↓</font></TD></TR>";
    document.write(__s);
}

function __fdate(_time) {
    var __y = formatDate(_time, "yyyy");
    var __m = formatDate(_time, "M");
    if (__m < 9) __m = ' ' + __m;
    var __d = formatDate(_time, "d");
    if (__d < 9) __d = ' ' + __d;
    return __y + '年' + __m + '月' + __d + '日';
}

function ShowInfo(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, aInfo, state, t2,tongxiao,_now,_b) {
    function __ver(_type) {
        var r;
        r = "<font color=#2277ff>";
        r += _type + "</font>";
        return r;
    }

    function URLDeCode(str) {
        var s = "";
        if (str.length == 0) return "";
        s = str.replace(/%3a/g, ":");
        return s.replace(/%2f/g, "/");
    }

    // function __qq(_info) {
    //      return "<a href=" + (_info.qq < 10001 ? decodeURIComponent(_info.home) + " target='_blank'>游戏查询" : "http://webqq.com/" + _info.qq + " target='_blank'>在线联系") + "</a>";
    //  }


    function __qq(_info) {
        if (_info.qq=="0") return "<a href="+decodeURIComponent(_info.home)+ " target='_blank'>游戏中查询</a>";
        return "<a href="+decodeURIComponent(_info.home)+ " target='_blank'>"+_info.qq+"</a>";
    }


    function __ftime(_time,tongxiao,_b) {
        var __y = formatDate(_time, "yyyy");
        var __m = formatDate(_time, "M");
        if (__m < 9) __m = ' ' + __m;
        var __d = formatDate(_time, "d");
        if (__d < 9) __d = ' ' + __d;
        var __h = formatDate(_time, "h");
        if (__h < 9) __h = ' ' + __h;
        var __n = formatDate(_time, "mm");
        var ss="";
        //return __y + '年/' + __m + '/月' + __d + '/日 ' + __h + '点' + __n + '分';
        if (tongxiao==1) {
            ss= __m + '/月' + __d + '/日 ' + '通宵推荐';
        } else if (tongxiao==2) {ss=  '★★精品全天推荐★★  ';}    //{ss=  __m + '/月' + __d + '/日 ' +'精品全天推荐 ';}
        else {ss=  __m + '/月' + __d + '/日 ' + __h + '点' + __n + '开放';}
        if (_b==true) {ss="<B>"+ss+"</B>";}
        return ss;
    }
    if (t2 == null) t2 = "";
    if (_now==null) _now="";
    document.write("<tr bgcolor=" + BGColor + " onmouseover=\"this.className='" + BGClass1 + "'\" onmouseout=\"this.className='" + BGClass2 + "'\"  height='20'>");
    document.write("<td>");
    document.write("    <table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
    document.write("      <tr>");
    document.write("<td><a href=" + decodeURIComponent(aInfo.home) + " target=_blank><font color='0'>" + (aInfo.name) + "</font></a></td>");
    document.write("        <td width='3' align='right'  style='FILTER: DropShadow(Color=#dddd22, OffX=1, OffY=1, Positive=1)'>");
    document.write("<font color=red>" + t2 + "</font>");
    document.write("	</td>");
    document.write("      </tr>");
    document.write("    </table>");
    document.write("</td>");
    document.write("<td width='60' > <font color='0'><a href=" + decodeURIComponent(aInfo.home) + " target=_blank> 下载登录器</font></td>");
    var ssv="";
    if (tongxiao==2) {ssv="<img src='Images/zhuan.gif' height=12></img>";}
    if (_b==true)  {ssv=" <img src='Images/k.gif' height=12></img>";}
    document.write("<td width='159'> <font color='" + TxtColor + "'>" + __ftime(aInfo.start,tongxiao,_b) + "</font>"+ssv+"</td>");
    document.write("    <td width='311'>");
    document.write("    <table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
    document.write("      <tr>");
    document.write("        <td width='271'><font color='0'>" + HTMLEnCode(aInfo.detail) + "</font></td>");
    document.write("        <td width='40' align='right'  style='FILTER: DropShadow(Color=#dddd22, OffX=1, OffY=1, Positive=1)'>");
    document.write(__ver(_now));
    document.write("	</td>");
    document.write("      </tr>");
    document.write("    </table>");
    document.write("   </td>");

    document.write("    <td width='55' align='center'> <font color='0'>" + aInfo.network + "</font></td>");
    document.write("    <td width='55' align='center'> <font color='" + TxtColor2 + "'>" + state + "</font></td>");
    document.write("    <td width='55' align='center'><font color='" + TxtColor + "'>" + __qq(aInfo) + "</font></td>");
    document.write("    <td width='55' align='center'><font color='" + TxtColor + "'><a href="+decodeURIComponent(aInfo.home)+" target='_blank'>点击查看</a></font></td>");
    document.write("</tr>");
}

function ShowArry(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry, state, t2,tongxiao,_now,_b) {
    for (var i = 0; i < arry.length; i = i + 1) {
        ShowInfo(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry[i], state, t2,tongxiao,_now,_b);
    }
}



var by = function(name,minor)
{
    return function(o, p)
    {
        var a, b;
        if (typeof o === "object" && typeof p === "object" && o && p)
        {
            a = o[name];
            b = p[name];
            if (a === b) {return typeof minor==='function' ?minor(o,p):0;}
            if (typeof a === typeof b) { return a < b ? -1 : 1;}
            return typeof a < typeof b ? -1 : 1;
        }
        else {throw ("error"); }
    }
}


function RanShowArry(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry, state, t2,tongxiao,_now,_b) {
    function RanArry(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry, state, t2,tongxiao,_now,_b) {
        function del(index, dataArray) {
            var len = dataArray.length;
            for (var i = 0; i < len; i = i + 1) {
                if (i == (index - 1)) {
                    for (var j = i + 1; j < len; j = j + 1) {
                        //当前索引值后的数据都向前移
                        dataArray[j - 1] = dataArray[j];
                    }

                    //移完之后,自身长度减1
                    dataArray.length--;
                }
            }
        }
        while (arry.length > 0) {
            var i = Math.ceil(Math.random() * arry.length);
            if (i == 0) i = 1;
            try {
                ShowInfo(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry[i - 1], state, t2,tongxiao,_now,_b);
            } finally {
                del(i, arry);
            }
        }
    }


///////////////////////
    var tArr = [];
    for (var i = 0; i < arry.length; i++) {
        try {
            var t_len = tArr.length;
            if ((t_len == 0) || (tArr[t_len - 1].start == arry[i].start)) {
                tArr[t_len] = arry[i];
                //alert(t_len);
            } else {
                //alert("123");
                RanArry(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, tArr, state, t2,tongxiao,_now,_b);
                tArr.length = 0;
                tArr[0] = arry[i];
            }

        } catch (e) {}
    }

    //  tArr.sort(by('name',by('home')));  //排序

    var sArr = [];
    for (var i = 0; i < tArr.length; i++) {
        try {
            var t_len = sArr.length;
            if (isIsArray(sArr,tArr[i])==false) {
                sArr[t_len] = tArr[i];
            }

        } catch (e) {}
    }

    RanArryxx(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, sArr,tArr, state, t2,tongxiao,_now,_b);
}


function RanArryxx(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry,tArr, state, t2,tongxiao,_now,_b) {
    function del(index, dataArray) {
        var len = dataArray.length;
        for (var i = 0; i < len; i = i + 1) {
            if (i == (index - 1)) {
                for (var j = i + 1; j < len; j = j + 1) {
                    //当前索引值后的数据都向前移
                    dataArray[j - 1] = dataArray[j];
                }

                //移完之后,自身长度减1
                dataArray.length--;
            }
        }
    }
    while (arry.length > 0) {
        var i = Math.ceil(Math.random() * arry.length);
        if (i == 0) i = 1;
        try {
            ShowArryx(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, arry[i - 1], tArr,state, t2,tongxiao,_now,_b);
        } finally {
            del(i, arry);
        }
    }
}

function ShowArryx(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, aInfo,tArr, state, t2,tongxiao,_now,_b) {
    for (var i = 0; i < tArr.length; i = i + 1) {
        if ((tArr[i].name==aInfo.name) && (tArr[i].home==aInfo.home) && (tArr[i].start==aInfo.start)) {
            ShowInfo(BGColor, BGClass1, BGClass2, TxtColor, TxtColor2, tArr[i], state, t2,tongxiao,_now,_b);
        }
    }
}


function isIsArray(array,aInfo)
{
    for (var i = 0; i < array.length; i++) {
        if ((array[i].name==aInfo.name) && (array[i].home==aInfo.home) && (array[i].start==aInfo.start)) {
            return true;
        }
    }
    return false;
}



function _sl() {
    /*--------------------------当前正在开放的服务器[↓]------------------------------*/
    if ((typeof listobj.NowList == "object") && (listobj.NowList.length > 0)) RanShowArry('#ffff00', 'bg6', 'bg3', 'red', '#FF0000', listobj.NowList, '当前开放', 'NEW',0,"←推荐",true);

    /*--------------------------一日顶固的服务器[↓]------------------------------*/
    if ((typeof listobj.OneDayList == "object") && (listobj.OneDayList.length > 0)) {
        RanShowArry('#ffeb99', 'bg6', 'bg13', 'blue', '#FF0000', listobj.OneDayList, '全天顶固', 'TOP',2,"←全天");
    }




    /*--------------------------今天已开放的服务器[↓]------------------------------*/
    if ((typeof listobj.TDayLast == "object") && (listobj.TDayLast.length > 0)) ShowArry('#ffff99', 'bg6', 'bgx1', '#000000', 'blue', listobj.TDayLast, '已经开放','',0);




    /*--------------------------当前正在开放的服务器[↓]------------------------------*/
    //  if ((typeof listobj.OneDayList == "object") && (listobj.OneDayList.length > 0)) RanShowArry('#ffff00', 'bg6', 'bg3', 'red', '#FF0000', listobj.OneDayList, '当前开放', 'NEW',0,"←推荐");

    if (listobj.Night==1) {
        /*--------------------------昨天通宵推荐服务器[↓]------------------------------*/
        //    if ((typeof listobj.NightTop == "object") && (listobj.NightTop.length > 0)) RanShowArry('#ffff00', 'bg6', 'bg3', 'red', 'blue', listobj.NightTop, '通宵推荐','',1);
    }


    /*--------------------------今天未开放的服务器[↓]------------------------------*/
    if ((typeof listobj.TDayFuture == "object") && (listobj.TDayFuture.length > 0)) ShowArry('#ffff99', 'bg6', 'bgx1', '#000000', '#00eaff', listobj.TDayFuture, '等待开放','',0);



    if (listobj.Night==0) {
        /*--------------------------昨天通宵推荐服务器[↓]------------------------------*/
        //   if ((typeof listobj.NightTop == "object") && (listobj.NightTop.length > 0)) RanShowArry('#ffff99', 'bg6', 'bgx1', '#000000', 'blue', listobj.NightTop, '通宵推荐','',1);
    }
    /*--------------------------明天未开放的服务器[↓]------------------------------*/
    if ((typeof listobj.NextDay == "object") && (listobj.NextDay.length > 0)) {
        PrintDrTitle(__fdate(listobj.NextDay[0].start) + "即将开放的服务器");
        ShowArry('#ffff99', 'bg6', 'bgx1', '#000000', '#00eaff', listobj.NextDay, '等待开放','',0);
    }

//    /*--------------------------后天未开放的服务器[↓]------------------------------*/
    if ((typeof listobj.ThirdDay == "object") && (listobj.ThirdDay.length > 0)) {
        PrintDrTitle(__fdate(listobj.ThirdDay[0].start) + "即将开放的服务器");
        ShowArry('#ffff99', 'bg6', 'bgx1', '#000000', '#00eaff', listobj.ThirdDay, '等待开放','',0);
    }

    /*--------------------------昨天已开放的服务器[↓]------------------------------*/
    if ((typeof listobj.beforeDay == "object") && (listobj.beforeDay.length > 0)) {
        PrintDrTitle(__fdate(listobj.beforeDay[0].start) + "已经开放的服务器");
        ShowArry('#ffff99', 'bg6', 'bgx1', '#000000', 'blue', listobj.beforeDay, '已经开放','',0);
    }
}
_sl();